local barchart = {} barchart.__index = barchart function barchart.new(settings) --{frame = frame, tbars = total bars,}, local t = setmetatable({}, barchart) t.frame = settings.frame or nil --if t.frame then t.frame.AnchorPoint = Vector2.new(1,1) end --anchor point not working as advertized t.tbars = math.max(settings.tbars or 10,0) --total bars t.barwidth = math.min(1/t.tbars,1) t.bars = {} --table of objects t.dataval = {} t.max = -math.huge t.min = math.huge t.average = 0 t.display = settings.display or {} return t end function barchart:fill() if not self.frame then self.frame = Instance.new("Frame") self.frame.AnchorPoint = Vector2.new(1,1) end if #self.bars b end) self.max = math.max(60,sorted[1] or 60) self.min = sorted[#sorted] or 60]] local min,max=1,0 local avg = 0 for i=totald,1,-1 do local h,index = math.min(self.dataval[i],1),(totald-i)+1 local b = self.bars[index] if hmax then max = h end b.Size,b.Position = UDim2.new(self.barwidth,0,h,0),UDim2.new(1-index*self.barwidth,0,1-h,0) avg=avg+h end avg = avg/totald if self.display.min then self.display.min.Text = "Min: "..string.format("%.2f", min*60) self.min = min end if self.display.max then delay(0.05,function() self.display.max.Text = "Max: "..string.format("%.2f", max*60) end) self.max = max end if self.display.avg then self.display.avg.Text = "Avg: "..string.format("%.2f", avg*60) self.average = avg end end function barchart:moveto(udim) if not self.frame then return end self.frame.Position = udim end function barchart:resize(size) --udim2 if not self.frame then return end self.frame.Size = size end local function Create(ty,parent) return function(data) local obj = Instance.new(ty,parent) if #data==1 then if typeof(data[1])=="table" then data = data[1] end end for k, v in pairs(data) do if type(k) == 'number' then v.Parent = obj else obj[k] = v end end return obj end end local Screen = Create("Part"){Parent=script,Size = Vector3.new(10,7,.1),CanTouch = false, Transparency=1,CanCollide=false,Locked=true,Anchored = true,CFrame = owner.Character.Torso.CFrame*CFrame.new(0,2,-10)*CFrame.Angles(0,math.rad(180),0)} FPSmonitor = Create("SurfaceGui"){Parent = owner.PlayerGui,ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Name = "FPSmonitor", } holder = Create("Frame"){Parent = FPSmonitor,BackgroundColor3 = Color3.fromRGB(65, 65, 65), Size = UDim2.new(1, 0, 1, 0), Name = "holder", } UICorner = Create("UICorner"){Parent = holder,} chart = Create("Frame"){Parent = holder,Style = Enum.FrameStyle.RobloxRound, BackgroundColor3 = Color3.fromRGB(255, 255, 255), Position = UDim2.new(0.050000000745058, 0, 0.30000001192093, 0), Size = UDim2.new(0.89999997615814, 0, 0.60000002384186, 0), Name = "chart", } TextHolder = Create("Frame"){Parent = holder,BackgroundColor3 = Color3.fromRGB(33, 33, 33), Position = UDim2.new(0.050000000745058, 0, 0.10000000149012, 0), Size = UDim2.new(0.89999997615814, 0, 0.15000000596046, 0), Name = "TextHolder", } Average = Create("TextBox"){Parent = TextHolder,Font = Enum.Font.SourceSans, BackgroundTransparency = 1, TextEditable = false, FontSize = Enum.FontSize.Size14, Text = "", TextColor3 = Color3.fromRGB(214, 214, 214), TextScaled = true, TextSize = 14, TextWrap = true, TextWrapped = true, BackgroundColor3 = Color3.fromRGB(68, 68, 68), BorderSizePixel = 0, Position = UDim2.new(0.275, 0, 0, 0), Size = UDim2.new(0.2, 0, 1, 0), Name = "Average", } FPS = Create("TextBox"){Parent = TextHolder,Font = Enum.Font.SourceSans, BackgroundTransparency = 1, TextEditable = false, FontSize = Enum.FontSize.Size14, Text = "", TextColor3 = Color3.fromRGB(214, 214, 214), TextScaled = true, TextSize = 14, TextWrap = true, TextWrapped = true, BackgroundColor3 = Color3.fromRGB(68, 68, 68), BorderSizePixel = 0, Position = UDim2.new(0.025, 0, 0, 0), Size = UDim2.new(0.2, 0, 1, 0), Name = "FPS", } Min = Create("TextBox"){Parent = TextHolder,Font = Enum.Font.SourceSans, BackgroundTransparency = 1, TextEditable = false, FontSize = Enum.FontSize.Size14, Text = "", TextColor3 = Color3.fromRGB(214, 214, 214), TextScaled = true, TextSize = 14, TextWrap = true, TextWrapped = true, BackgroundColor3 = Color3.fromRGB(68, 68, 68), BorderSizePixel = 0, Position = UDim2.new(0.525, 0, 0, 0), Size = UDim2.new(0.2, 0, 1, 0), Name = "Min", } Max = Create("TextBox"){Parent = TextHolder,Font = Enum.Font.SourceSans, BackgroundTransparency = 1, TextEditable = false, FontSize = Enum.FontSize.Size14, Text = "", TextColor3 = Color3.fromRGB(214, 214, 214), TextScaled = true, TextSize = 14, TextWrap = true, TextWrapped = true, BackgroundColor3 = Color3.fromRGB(68, 68, 68), BorderSizePixel = 0, Position = UDim2.new(0.775, 0, 0, 0), Size = UDim2.new(0.2, 0, 1, 0), Name = "Max", } local g = barchart.new{frame = chart,tbars = 30,maxval = 60,display = {min=Min,max=Max,avg=Average}} g:fill() local other = true delay(0,function() FPSmonitor.Parent = Screen end) --t.CFrame = Screen.CFrame*CFrame.new(10) local currbeat = 0 game:GetService('RunService').Heartbeat:connect(function(step) if other then FPS.Text = "FPS: "..string.format("%.2f", math.min(1/step,60)) currbeat = step else currbeat=(currbeat+step)/2 g:update((1/currbeat)/60) end other = not other end) --[[ --could be cool local hum = owner.Character.Humanoid local tor = owner.Character.Torso while wait() do if tor.Position.Y<7 then hum:ChangeState(Enum.HumanoidStateType.Jumping) end end function drawPath(Line, P1, P2) local Size = game.Workspace.CurrentCamera.ViewportSize local startX, startY = P1.Position.X.Scale*Size.X, P1.Position.Y.Scale*Size.Y local endX, endY = P2.Position.X.Scale*Size.X, P2.Position.Y.Scale*Size.Y local startVector = Vector2.new(startX, startY) local endVector = Vector2.new(endX, endY) local Distance = (startVector - endVector).Magnitude Line.AnchorPoint = Vector2.new(0.5, 0.5) Line.Size = UDim2.new(0, Distance, 0, 5) Line.Position = UDim2.new(0, (startX + endX) / 2, 0, (startY + endY) / 2) Line.Rotation = math.atan2(endY - startY, endX - startX) * (180 / math.pi) end local hum = owner.Character.Humanoid hum.HealthChanged:connect(function(newhp) hum.Health = math.max(.01,newhp) end) workspace.DescendantAdded:connect(function(des) if des:IsA("Explosion") then des:Destroy() end end) ]]